﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace WoChu.RfClient.Entity
{
   public   class ResultModel<T>
    {
       private   ResultModel<T> Instance;
     public   ResultModel<T> GetInstance()
     {

         //if (string.IsNullOrEmpty(msg))
             //msg = "网络异常";
         //var type = Instance.DATA.GetType();
         //var value = Instance.DATA;

         //if (type == typeof(int))
         //    value = 0;

         //else if (type == typeof(bool))
         //    value = false;

         //else if (type == typeof(string))
         //    value = "";
         //else
         //    value = null;
 
           if(Instance==null)
           {
               Instance = new ResultModel<T> { 
                RESULT="0",
                DATA = default(T),
                MESSAGE = "网络异常"
               };
           }
           return Instance;
      }

        private string _RESULT;

        public string RESULT
        {
            get {
                if (_RESULT == null)
                    return "";
                else
                    return _RESULT; 
            
            }
            set { _RESULT = value; }
        }
        public string MESSAGE { set; get; }
         
        public T DATA {
            set;
            get; }
    }
}
